﻿<html>
<title> Bài 12</title>
<FORM METHOD = POST ACTION="#">	
 </center>  
   <center><h1><b><font color="blue">Bài 12 <hr width =30%></font></h1></u>
      <br>
   <font color="blue" size="30">
   <hr width =50%>
	<?php
     Echo " Các số cần tìm :";
	for($t=10;$t<9999;$t++)
	{
	    $a=$t; //echo " <br> Chuỗi:".$a;
        $l=strlen($a);//echo "<br> Độ dài xâu: ".$l."<br>";
              $cong="";
			  $nhan=1;
			  $x=0;
				 $A=array ();
	   for($x=0;$x<$l;$x++)
           {   global $str,$kq,$A,$x;
               $chuoi=substr($a,$x+1,$l);//echo "<br>chuỗi đã cắt xong : ".$chuoi;
	           $str = substr($a,$x,(($x+1)-$x));//ECHO "<br>ký tự dc tách ra:".$str;
               $A[$x]=$str;
			 // echo "<br>A[$x]=".$A[$x];
		     // echo "khùng nì";
	           $cong=$cong+$A[$x];//echo "<br> phép cộng ".$cong;
		       $nhan=$nhan*$A[$x];//echo "<br> phép nhan ".$nhan;
		  if($nhan==$cong && $x==($l-1))
		     { echo "<br>". $a;}
        }}
?>
    <br><br>
</html>